autocmd BufNewFile,BufRead */cookbooks/*/\(attributes\|definitions\|libraries\|providers\|recipes\|resources\)/*.rb set filetype=chef

autocmd BufNewFile,BufRead */cookbooks/*/templates/*/*.erb set filetype=eruby.chef
autocmd BufNewFile,BufRead */cookbooks/*/templates/*/*xml* set filetype=xml
autocmd BufNewFile,BufRead */cookbooks/*/metadata.rb set filetype=chef

autocmd BufNewFile,BufRead */chef-repo/environments/*.rb set filetype=chef
autocmd BufNewFile,BufRead */chef-repo/roles/*.rb set filetype=chef

autocmd BufNewFile,BufRead Cheffile set filetype=chef
autocmd BufNewFile,BufRead Berksfile set filetype=chef

" Thor
au BufNewFile,BufRead [tT]horfile,*.thorcall set filetype=ruby 

